package com.byedu.domain.focus.vo;

import com.byedu.domain.focus.FocusWorkorderDO;
import com.byedu.domain.focus.vo.enumvos.FocusDepartmentTypeVO;
import com.byedu.domain.focus.vo.enumvos.FocusStatusEcxuteVO;
import com.byedu.util.CommonUtil;

import java.io.Serializable;

/**
 * Created by Luo on 2017-08-23.
 */
public class FocusWorkorderVO implements Serializable {

    /*工单编号*/
    private String id;
    /*用户名*/
    private String name;
    /*项目id*/
    private FocusProjectVO project;
    /*描述Id*/
    private String decfile;
    /*开始时间*/
    private String starttime;
    /*截止时间*/
    private String excuttime;
    /*完成时间*/
    private String finishtime;
    /*执行部门*/
    private FocusDepartmentTypeVO depart;
    /*执行人*/
    private FocusUserVO user;

    public FocusUserVO getFauser() {
        return fauser;
    }

    public void setFauser(FocusUserVO fauser) {
        this.fauser = fauser;
    }

    /*执行人*/
    private FocusUserVO fauser;

    /*证明文件*/
    private String certifile;
    /*工单状态*/
    private FocusStatusEcxuteVO status;
    /*状态说明*/
    private String statustr;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public FocusProjectVO getProject() {
        return project;
    }

    public void setProject(FocusProjectVO project) {
        this.project = project;
    }

    public String getDecfile() {
        return decfile;
    }

    public void setDecfile(String decfile) {
        this.decfile = decfile;
    }

    public String getStarttime() {
        return starttime;
    }

    public void setStarttime(String starttime) {
        this.starttime = starttime;
    }

    public String getExcuttime() {
        return excuttime;
    }

    public void setExcuttime(String excuttime) {
        this.excuttime = excuttime;
    }

    public String getFinishtime() {
        return finishtime;
    }

    public void setFinishtime(String finishtime) {
        this.finishtime = finishtime;
    }

    public FocusDepartmentTypeVO getDepart() {
        return depart;
    }

    public void setDepart(FocusDepartmentTypeVO depart) {
        this.depart = depart;
    }

    public FocusUserVO getUser() {
        return user;
    }

    public void setUser(FocusUserVO user) {
        this.user = user;
    }

    public String getCertifile() {
        return certifile;
    }

    public void setCertifile(String certifile) {
        this.certifile = certifile;
    }

    public FocusStatusEcxuteVO getStatus() {
        return status;
    }

    public void setStatus(FocusStatusEcxuteVO status) {
        this.status = status;
    }
    public FocusWorkorderVO() {}

    public FocusWorkorderVO(FocusWorkorderDO focusWorkDO, FocusUserVO user,  FocusUserVO fauser, FocusProjectVO focusProjectVO) {
        if(focusWorkDO != null) {
            this.id = focusWorkDO.getId();
            this.name = focusWorkDO.getName();
            this.project = focusProjectVO;
            this.decfile = focusWorkDO.getDecfile();
            this.starttime = focusWorkDO.getStarttime();
            this.excuttime = focusWorkDO.getExcuttime();
            this.finishtime = focusWorkDO.getFinishtime();
            this.depart =  new FocusDepartmentTypeVO(focusWorkDO.getDepart());
            this.user = user;
            this.fauser = fauser;
            this.certifile = focusWorkDO.getCertifile();
            this.status = new FocusStatusEcxuteVO(CommonUtil.StringToInt(focusWorkDO.getStatus()));
            this.statustr = focusWorkDO.getStatustr();
        }
    }

    @Override
    public String toString() {
        return "FocusWorkVO{" +
         "id='" + id + '\'' +
         ", name='" + name + '\'' +
         ", project=" + project +
         ", decfile='" + decfile + '\'' +
         ", starttime='" + starttime + '\'' +
         ", excuttime='" + excuttime + '\'' +
         ", finishtime='" + finishtime + '\'' +
         ", depart=" + depart +
         ", user='" + user + '\'' +
         ", certifile='" + certifile + '\'' +
         ", status=" + status +
         ", statustr=" + statustr +
         '}';
    }

    public String getStatustr() {
        return statustr;
    }

    public void setStatustr(String statustr) {
        this.statustr = statustr;
    }
}
